* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 默认主题 */
body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f0f0;
    color: #333;
    padding: 20px;
    transition: all 0.3s ease;
}

.game-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: all 0.3s ease;
}

/* 暗黑主题 */
body.theme-dark {
    background-color: #121212;
    color: #e0e0e0;
}

body.theme-dark .game-container {
    background-color: #1e1e1e;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

body.theme-dark .header h1 {
    color: #bb86fc;
}

body.theme-dark .game-info {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

body.theme-dark .cell {
    background-color: #333333;
}

body.theme-dark .cell:hover {
    background-color: #444444;
}

body.theme-dark .status-bar {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

/* 明亮主题 */
body.theme-light {
    background-color: #ffffff;
    color: #121212;
}

body.theme-light .game-container {
    background-color: #f8f9fa;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
}

body.theme-light .header h1 {
    color: #0056b3;
}

body.theme-light .game-info {
    background-color: #e9ecef;
}

body.theme-light .cell {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
}

body.theme-light .cell:hover {
    background-color: #f1f3f5;
}

body.theme-light .status-bar {
    background-color: #e9ecef;
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
}

#resources {
    display: flex;
    gap: 20px;
}

.resource {
    font-weight: bold;
}

.resource.blue {
    color: #3498db;
}

.resource.red {
    color: #e74c3c;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    margin-bottom: 20px;
    background-color: #34495e;
    padding: 2px;
    border-radius: 5px;
}

/* 无网格线样式 */
.game-board.no-grid {
    gap: 0;
    padding: 0;
    background-color: transparent;
}

.game-board.no-grid .cell {
    border-radius: 0;
}

.cell {
    aspect-ratio: 1;
    background-color: #ecf0f1;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.cell:hover {
    background-color: #d5dbdb;
}

.cell.selected {
    background-color: #f39c12;
}

.cell.highlight-move {
    background-color: #2ecc71;
}

.cell.highlight-attack {
    background-color: #e74c3c;
}

.unit {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    position: relative;
}

.unit.blue {
    background-color: #3498db;
}

.unit.red {
    background-color: #e74c3c;
}

.unit::after {
    content: attr(data-health);
    position: absolute;
    bottom: -5px;
    right: -5px;
    background-color: white;
    color: #333;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #333;
}

/* 移动成本指示器 */
.movement-cost {
    position: absolute;
    top: 2px;
    left: 2px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* 地形效果提示 */
.cell {
    position: relative;
}

.cell::before {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 8px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 3;
    pointer-events: none;
}

.cell.terrain-mountain::before {
    content: "山地: 防御+30%";
}

.cell.terrain-forest::before {
    content: "森林: 防御+20%";
}

.cell.terrain-water::before {
    content: "水域: 无法通行";
}

.cell.terrain-city::before {
    content: "城市: 防御+25%, 资源+5";
}

.cell:hover::before {
    opacity: 1;
}

.controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.unit-controls, .game-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

button {
    padding: 8px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #2980b9;
}

button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

#end-turn {
    background-color: #2ecc71;
}

#end-turn:hover {
    background-color: #27ae60;
}

#restart-game {
    background-color: #e74c3c;
}

#restart-game:hover {
    background-color: #c0392b;
}

#save-game {
    background-color: #9b59b6;
}

#save-game:hover {
    background-color: #8e44ad;
}

#main-menu {
    background-color: #f39c12;
}

#main-menu:hover {
    background-color: #e67e22;
}

.status-bar {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-style: italic;
}

/* 地形样式 */
.cell.terrain-mountain {
    background-color: #95a5a6;
}

.cell.terrain-forest {
    background-color: #27ae60;
}

.cell.terrain-water {
    background-color: #3498db;
}

.cell.terrain-city {
    background-color: #f1c40f;
}

/* 单位类型图标 */
.unit.infantry::before {
    content: "步";
}

.unit.tank::before {
    content: "坦";
}

.unit.artillery::before {
    content: "炮";
}